3.192 \(\int \tan ^4(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=60 \[ \frac{(a-b) \tan ^3(e+f x)}{3 f}-\frac{(a-b) \tan (e+f x)}{f}+x (a-b)+\frac{b \tan ^5(e+f x)}{5 f} \]

[Out]

(a - b)*x - ((a - b)*Tan[e + f*x])/f + ((a - b)*Tan[e + f*x]^3)/(3*f) + (b*Tan[e + f*x]^5)/(5*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0430068, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3631, 3473, 8} \[ \frac{(a-b) \tan ^3(e+f x)}{3 f}-\frac{(a-b) \tan (e+f x)}{f}+x (a-b)+\frac{b \tan ^5(e+f x)}{5 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^4*(a + b*Tan[e + f*x]^2),x]

[Out]

(a - b)*x - ((a - b)*Tan[e + f*x])/f + ((a - b)*Tan[e + f*x]^3)/(3*f) + (b*Tan[e + f*x]^5)/(5*f)

Rule 3631

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[A - C, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[
{a, b, e, f, A, C, m}, x] && NeQ[A*b^2 + a^2*C, 0] &&  !LeQ[m, -1]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \tan ^4(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{b \tan ^5(e+f x)}{5 f}+(a-b) \int \tan ^4(e+f x) \, dx\\ &=\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{b \tan ^5(e+f x)}{5 f}+(-a+b) \int \tan ^2(e+f x) \, dx\\ &=-\frac{(a-b) \tan (e+f x)}{f}+\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{b \tan ^5(e+f x)}{5 f}+(a-b) \int 1 \, dx\\ &=(a-b) x-\frac{(a-b) \tan (e+f x)}{f}+\frac{(a-b) \tan ^3(e+f x)}{3 f}+\frac{b \tan ^5(e+f x)}{5 f}\\ \end{align*}

Mathematica [A]  time = 0.0373539, size = 97, normalized size = 1.62 \[ \frac{a \tan ^3(e+f x)}{3 f}+\frac{a \tan ^{-1}(\tan (e+f x))}{f}-\frac{a \tan (e+f x)}{f}+\frac{b \tan ^5(e+f x)}{5 f}-\frac{b \tan ^3(e+f x)}{3 f}-\frac{b \tan ^{-1}(\tan (e+f x))}{f}+\frac{b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^4*(a + b*Tan[e + f*x]^2),x]

[Out]

(a*ArcTan[Tan[e + f*x]])/f - (b*ArcTan[Tan[e + f*x]])/f - (a*Tan[e + f*x])/f + (b*Tan[e + f*x])/f + (a*Tan[e +
 f*x]^3)/(3*f) - (b*Tan[e + f*x]^3)/(3*f) + (b*Tan[e + f*x]^5)/(5*f)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 92, normalized size = 1.5 \begin{align*}{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{5}}{5\,f}}+{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{3}a}{3\,f}}-{\frac{b \left ( \tan \left ( fx+e \right ) \right ) ^{3}}{3\,f}}-{\frac{a\tan \left ( fx+e \right ) }{f}}+{\frac{b\tan \left ( fx+e \right ) }{f}}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a}{f}}-{\frac{b\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^4*(a+b*tan(f*x+e)^2),x)

[Out]

1/5*b*tan(f*x+e)^5/f+1/3/f*tan(f*x+e)^3*a-1/3*b*tan(f*x+e)^3/f-1/f*a*tan(f*x+e)+b*tan(f*x+e)/f+1/f*arctan(tan(
f*x+e))*a-b/f*arctan(tan(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 1.68851, size = 77, normalized size = 1.28 \begin{align*} \frac{3 \, b \tan \left (f x + e\right )^{5} + 5 \,{\left (a - b\right )} \tan \left (f x + e\right )^{3} + 15 \,{\left (f x + e\right )}{\left (a - b\right )} - 15 \,{\left (a - b\right )} \tan \left (f x + e\right )}{15 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/15*(3*b*tan(f*x + e)^5 + 5*(a - b)*tan(f*x + e)^3 + 15*(f*x + e)*(a - b) - 15*(a - b)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.0566, size = 134, normalized size = 2.23 \begin{align*} \frac{3 \, b \tan \left (f x + e\right )^{5} + 5 \,{\left (a - b\right )} \tan \left (f x + e\right )^{3} + 15 \,{\left (a - b\right )} f x - 15 \,{\left (a - b\right )} \tan \left (f x + e\right )}{15 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/15*(3*b*tan(f*x + e)^5 + 5*(a - b)*tan(f*x + e)^3 + 15*(a - b)*f*x - 15*(a - b)*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 0.663574, size = 82, normalized size = 1.37 \begin{align*} \begin{cases} a x + \frac{a \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac{a \tan{\left (e + f x \right )}}{f} - b x + \frac{b \tan ^{5}{\left (e + f x \right )}}{5 f} - \frac{b \tan ^{3}{\left (e + f x \right )}}{3 f} + \frac{b \tan{\left (e + f x \right )}}{f} & \text{for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right ) \tan ^{4}{\left (e \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**4*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((a*x + a*tan(e + f*x)**3/(3*f) - a*tan(e + f*x)/f - b*x + b*tan(e + f*x)**5/(5*f) - b*tan(e + f*x)**
3/(3*f) + b*tan(e + f*x)/f, Ne(f, 0)), (x*(a + b*tan(e)**2)*tan(e)**4, True))

________________________________________________________________________________________

Giac [B]  time = 2.63965, size = 855, normalized size = 14.25 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^4*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/15*(15*a*f*x*tan(f*x)^5*tan(e)^5 - 15*b*f*x*tan(f*x)^5*tan(e)^5 - 75*a*f*x*tan(f*x)^4*tan(e)^4 + 75*b*f*x*ta
n(f*x)^4*tan(e)^4 + 15*a*tan(f*x)^5*tan(e)^4 - 15*b*tan(f*x)^5*tan(e)^4 + 15*a*tan(f*x)^4*tan(e)^5 - 15*b*tan(
f*x)^4*tan(e)^5 + 150*a*f*x*tan(f*x)^3*tan(e)^3 - 150*b*f*x*tan(f*x)^3*tan(e)^3 - 5*a*tan(f*x)^5*tan(e)^2 + 5*
b*tan(f*x)^5*tan(e)^2 - 75*a*tan(f*x)^4*tan(e)^3 + 75*b*tan(f*x)^4*tan(e)^3 - 75*a*tan(f*x)^3*tan(e)^4 + 75*b*
tan(f*x)^3*tan(e)^4 - 5*a*tan(f*x)^2*tan(e)^5 + 5*b*tan(f*x)^2*tan(e)^5 - 150*a*f*x*tan(f*x)^2*tan(e)^2 + 150*
b*f*x*tan(f*x)^2*tan(e)^2 - 3*b*tan(f*x)^5 + 10*a*tan(f*x)^4*tan(e) - 25*b*tan(f*x)^4*tan(e) + 120*a*tan(f*x)^
3*tan(e)^2 - 150*b*tan(f*x)^3*tan(e)^2 + 120*a*tan(f*x)^2*tan(e)^3 - 150*b*tan(f*x)^2*tan(e)^3 + 10*a*tan(f*x)
*tan(e)^4 - 25*b*tan(f*x)*tan(e)^4 - 3*b*tan(e)^5 + 75*a*f*x*tan(f*x)*tan(e) - 75*b*f*x*tan(f*x)*tan(e) - 5*a*
tan(f*x)^3 + 5*b*tan(f*x)^3 - 75*a*tan(f*x)^2*tan(e) + 75*b*tan(f*x)^2*tan(e) - 75*a*tan(f*x)*tan(e)^2 + 75*b*
tan(f*x)*tan(e)^2 - 5*a*tan(e)^3 + 5*b*tan(e)^3 - 15*a*f*x + 15*b*f*x + 15*a*tan(f*x) - 15*b*tan(f*x) + 15*a*t
an(e) - 15*b*tan(e))/(f*tan(f*x)^5*tan(e)^5 - 5*f*tan(f*x)^4*tan(e)^4 + 10*f*tan(f*x)^3*tan(e)^3 - 10*f*tan(f*
x)^2*tan(e)^2 + 5*f*tan(f*x)*tan(e) - f)